package com.lollipop.synthential.basicdatatypeconvert;

import java.text.DecimalFormat;

/**
 * @Author: J.K
 * @Date: 2021-06-12 09:43
 * @Description: 格式化字符串
 */
public class FormatString {
    public static void main(String[] args) {
        String str = "212";
        Double cny = Double.parseDouble(str);
        DecimalFormat df = new DecimalFormat("0.00");
        str = df.format(cny);
        System.out.println(str);
    }
}
